package com.imooc.pojo;

import com.baomidou.mybatisplus.annotation.*;
import org.springframework.beans.BeanUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.ToString;

/**
 * 商品表 商品信息相关表：分类表，商品图片表，商品规格表，商品参数表
 * 
 * @author yukangkang
 * @email 1304473884@qq.com
 * @date 2021-01-16 21:20:11
 */
@Data
@ToString
@TableName("items")
public class Items implements Serializable {
	private static final long serialVersionUID = 1L;

		/**
		 * 商品主键id
		 */
		@TableId(value = ID, type = IdType.AUTO)
		private String id;
		/**
		 * 商品名称 商品名称
		 */
		@TableField(ITEM_NAME)
		private String itemName;
		/**
		 * 分类外键id 分类id
		 */
		@TableField(CAT_ID)
		private Integer catId;
		/**
		 * 一级分类外键id
		 */
		@TableField(ROOT_CAT_ID)
		private Integer rootCatId;
		/**
		 * 累计销售 累计销售
		 */
		@TableField(SELL_COUNTS)
		private Integer sellCounts;
		/**
		 * 上下架状态 上下架状态,1:上架 2:下架
		 */
		@TableField(ON_OFF_STATUS)
		private Integer onOffStatus;
		/**
		 * 商品内容 商品内容
		 */
		@TableField(CONTENT)
		private String content;
		/**
		 * 创建时间
		 */
		@TableField(CREATED_TIME)
		private Date createdTime;
		/**
		 * 更新时间
		 */
		@TableField(UPDATED_TIME)
		private Date updatedTime;




	public final static String ID =  "`id`";
	public final static String ITEM_NAME =  "`item_name`";
	public final static String CAT_ID =  "`cat_id`";
	public final static String ROOT_CAT_ID =  "`root_cat_id`";
	public final static String SELL_COUNTS =  "`sell_counts`";
	public final static String ON_OFF_STATUS =  "`on_off_status`";
	public final static String CONTENT =  "`content`";
	public final static String CREATED_TIME =  "`created_time`";
	public final static String UPDATED_TIME =  "`updated_time`";


	public final static String ID_COMMENT =  "商品主键id";
	public final static String ITEM_NAME_COMMENT =  "商品名称 商品名称";
	public final static String CAT_ID_COMMENT =  "分类外键id 分类id";
	public final static String ROOT_CAT_ID_COMMENT =  "一级分类外键id";
	public final static String SELL_COUNTS_COMMENT =  "累计销售 累计销售";
	public final static String ON_OFF_STATUS_COMMENT =  "上下架状态 上下架状态,1:上架 2:下架";
	public final static String CONTENT_COMMENT =  "商品内容 商品内容";
	public final static String CREATED_TIME_COMMENT =  "创建时间";
	public final static String UPDATED_TIME_COMMENT =  "更新时间";


	public static Items of(Object obj) {
		Items e = new Items();
		BeanUtils.copyProperties(obj, e);
		return e;
	}

	public static QueryWrapper<Items> queryWrapper(Object obj) {
		return new QueryWrapper<>(of(obj));
	}



}
